package NC114_旋转字符串;

import java.util.*;


public class Solution {
    /**
     * 旋转字符串
     * @param A string字符串
     * @param B string字符串
     * @return bool布尔型
     */
    public boolean solve (String A, String B) {
        // write code here
        if (A == null || B == null || A.length() != B.length()){
            return false;
        }
        int i = 1;
        while (i < A.length()){
            String head = A.substring(0, i);
            String tail = A.substring(i);
            if (B.contains(head) && B.contains(tail)){
                return true;
            }
            i++;
        }
        return false;
    }
}